import com.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Mytest {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        User user = context.getBean("user",User.class);
        User user2 = context.getBean("user",User.class);
        //spring中只有一份实例
        System.out.println(user==user2);
        user.toShow();
    }
}
